<template>
	<view>
		<view class="title">
			<text class="t1">用户信息</text>
			<text class="t2">推广时间</text>
			<text class="t3">奖励</text>
		</view>
		<view class="content" v-for="(row,index) in content" :key="index">
			<view class="name">{{row.nickname}}</view>
			<!-- <view class="phone" v-if="row.mobile==''">未输入</view> -->
			<view class="phone"> {{row.reg_time}}</view>
			<view class="bj">
			      <view class="tong2">+{{row.cash}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				content:[{},{}],
				num:1,
				select:'',
				timearr:[]
			}
		},
		onLoad() {
			uni.showLoading({
			    title: '加载中'
			});
			this.getdata()
		},
		onShow() {
			this.getdata()
		},
		onReachBottom(){
			uni.showLoading({
			    title: '加载中'
			});
			this.gettuijian()
		},
		methods: {
			
			onPullDownRefresh: function() {
				this.getdata()
			},
			// 首次获取数据
			 getdata() {
				 this.$api.sendRequest({
							url: '/api/member/tuiguanglist',
							data: {
								page:1,
								page_size:20
							},
							success: res => {
								console.log(res)
								this.content=res.data.list
								uni.hideLoading()
								uni.stopPullDownRefresh()
							}
						});
			   },
				
			// 分页获取数据
			 gettuijian() {
			    var that = this
				var num = this.num
					this.num++
					num++
				this.$api.sendRequest({
					url: '/api/member/tuiguanglist',
					data: {
						page:that.num,
						page_size:10
					},
					success: res => {
						if(res.data.list.length>0){
						for(var i=0;i<res.data.list.length;i++){
							that.content.push(res.data.list[i])
						}}else{
							uni.showToast({
								title:"已到最底部",
								icon:"none"
							})
						}
						console.log(res)
						uni.hideLoading()
						uni.stopPullDownRefresh()
					}
					});
			    
			   },
			 
		}
	}
</script>

<style>
	.title{
		width: 100%;
		height: 80upx;
		line-height: 80upx;
		background:#dadada ;
	}
	.t1{
		width: 30%;
		line-height: 80upx;
		float: left;
		padding-left: 20upx;
		box-sizing: border-box;
		/* text-align: center; */
	}
	.t2{
		width: 30%;
		line-height: 80upx;
		float: left;
		text-align: center;
	}
	.t3{
		width: 40%;
		line-height: 80upx;
		float: left;
		text-align: center;
	}
	.content{
		width: 100%;
		height: 100upx;
		
		padding: 0upx 20upx;
		box-sizing: border-box;
		border-bottom: #777777 solid 1upx;
	}
	.name{
		width: 30%;
		line-height: 100upx;
		float: left;
	}
	.phone{
		width: 30%;
		line-height: 100upx;
		text-align: center;
		float: left;
	}
	.bj{
		width: 40%;
		float: left;
		
		display: flex;
		justify-content: space-between;
	}
	.shen{
		width: 70%;
		float: left;
		height: 100upx;
	}
	.b1{
		width: 50%;
		height: 60upx;
		margin-top: 20upx;
		border-radius: 30upx;
		color: #FFFFFF;
		text-align: center;
		line-height: 60upx;
		float: left;
		background: #45bf1f;
	}
	.b2{
		width: 50%;
		height: 60upx;
		margin-top: 20upx;
		border-radius: 30upx;
		color: #FFFFFF;
		text-align: center;
		line-height: 60upx;
		float: left;
		background: #ff5600;
	}
	
	.tong1{
		width: 100%;
		line-height: 100upx;
		text-align: center;
		color: #45bf1f;
	}
	.tong2{
		width: 100%;
		line-height: 100upx;
		text-align: center;
		color: red;
	}
	.b3{
		width: 30%;
		height: 60upx;
		margin-top: 20upx;
		border-radius: 30upx;
		color: #FFFFFF;
		text-align: center;
		line-height: 60upx;
		float: left;
		background: #b4b3b3;
	}
</style>
